﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PSE.Framework.Configuration;

namespace PSE.Framework.Versions.ApplicationBase
{
    public abstract class VersionsApplication<TConfigurationObjectType> : PSE.Framework.UI.Application.SmartClient.Application<TConfigurationObjectType>
     where TConfigurationObjectType : struct
    {
        public string SystemName { get; set; }
        public int MajorVersion { get; set; }

        public VersionsApplication()
        {
            this.ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
        }

        protected override void OnApplicationStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnApplicationStartup(sender, e);

            VersionsWindow window = new VersionsWindow();
            window.SystemName = this.SystemName;
            window.MajorVersion = this.MajorVersion;
            this.MainWindow = window;

            window.Show();
        }

        protected override bool AuthenticateUser()
        {
            return true;
        }
    }
}